<?php

namespace app\common\service;


class HostInitialRule extends Base 

{
    /**
     * @name: 列表
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2019-10-31 15:48:43
     */
    function list ($host_id, $content, $limit)
    {
        $server = db('HostInitialRule')->where('host_id', $host_id);

        empty($content) ? : $server = $server->whereLike('content', '%' . $content . '%');

        $return = $server->paginate($limit)->toArray();

        return $return;
    }

    /**
     * @name: 删除
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2019-10-31 15:53:19
     */
    function delete ($host_id, $id)
    {
        db('HostInitialRule')->where('id', $id)->where('host_id', $host_id)->delete();
    }
}